﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using HZ.Supervise.Model;

namespace HZ.Supervise.Web.Message
{
    public partial class MessageFinalDetailForType14 : System.Web.UI.Page
    {
        IBLL.IBLL_MessageTypeDetail ibllMessage = new BLL.BLL_MessageTypeDetail();
        string id;
        string _strTypeId;
        string _strMessageTypeDetailId;
        string _strSqlWhere;
        string _strSqlHaving;
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                ViewState["query"] = URLUtil.GetSuperviseQueryFromURL(Request);
                //MessageTypeDetail mess = (MessageTypeDetail)ViewState["query"];
                SuperviseQuery sq = (SuperviseQuery)ViewState["query"];
                //_strMessageTypeDetailId = mess.MessageDetailId;
                //_strTypeId = mess.TypeId.ToString();
                _strSqlWhere = sq.SqlStringWhere;
                _strSqlHaving = sq.Append;//暂时用用这个字段
                BindData(_strSqlWhere);
            }
        }
        void BindData(string _strSqlWhere)
        {
            if (!string.IsNullOrEmpty(_strSqlWhere))
            {
                int t = 0;
                gvwMessageDetailList.DataSource = ibllMessage.GetMessageOrderDetailBySubsidy(_strSqlWhere,_strSqlHaving, AspNetPager1.CurrentPageIndex, AspNetPager1.PageSize, out t);
                gvwMessageDetailList.DataBind();
                AspNetPager1.RecordCount = t;
            }

        }
        protected void btnExit_Click(object sender, EventArgs e)
        {
            Response.Redirect("MessageList.aspx");
        }

        protected void AspNetPager1_PageChanged(object sender, EventArgs e)
        {
            BindData(_strSqlWhere);
        }
    }
}
